import 'package:flutter/material.dart';

class MineButton extends StatefulWidget {
  final String buttonName;
  final Color? textColor;
  final Color? bgColor;
  final Function? onPress;

  const MineButton({super.key,
      required this.buttonName,
      this.textColor,
      this.bgColor,
      this.onPress
  });

  @override
  State<MineButton> createState() => _MineButtonState();
}

class _MineButtonState extends State<MineButton> {
  @override
  Widget build(BuildContext context) {
    Widget build = ElevatedButton(
        onPressed: (){
          if(widget.onPress!=null){
            widget.onPress!();
          }
        },
        style: ElevatedButton.styleFrom(
          backgroundColor: widget.bgColor??Colors.blueGrey,
          foregroundColor: widget.textColor??Colors.white,
          fixedSize: const Size(200,40),
        ),
        child: Text(widget.buttonName,style: const TextStyle(fontSize: 20)),
    );
    return build;
  }
}
